#include "i2c_io_expansion.h"
/*
 * @brief 将i2c地址位进行自动换算,便于所用即所得开发
 * @param A2A1A0 IO拓展芯片的可编辑地址位
 * @return 换算后的IIC地址
 * @author Atul
 * @date 2023-11-11 06:30:00
 * @version 1.0
 */
char slaveaddr_change(char A2A1A0)
{
        char High4 = 0x20;//0010 0000
        A2A1A0 = High4 | A2A1A0;
        //printf("slaveaddr_change is %X \n", A2A1A0);
        return A2A1A0;
}

uint16_t read_i2c_io_16bit(char A2A1A0)
{
        char SlaveAddr;
        uint16_t value;
        SlaveAddr = slaveaddr_change(A2A1A0);
        value = i2c_read_slave(SlaveAddr, I2C_MATER_READ);
        return value;
}
